<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.global.js"></script>
</head>

<body>
    <div id="app"></div>
    <script>
        Vue.createApp({
            data() {
                return {
                    show: true
                }
            },
            mounted() {
                // 方法 生命周期
            },
            methods: {
                handleBtnClick() {
                    // console.log(this.content)
                    // content newContent = content
                    // this.content = this.content.split('').reverse().join('')



                    //show ==> true
                    //!show ==> false
                    //第二次点击 !false ==> true
                    this.show = !this.show
                }
            },
            template: `
        <div>
        <span v-show = "show">hello world! JS</span>
        <button v-on:click = "handleBtnClick">显示/隐藏</button>
        </div>
    `
        }).mount('#app')

        // v-if 控制标签存在与否  ===> 如果为false，标签（节点）也会被移除掉
        // v-show 控制标签显示隐藏   这个标签还存在，只是改变了display
    </script>
</body>

</html>